local ls_name = 'clangd'

vim.lsp.enable(ls_name)

vim.lsp.config[ls_name] = {
  cmd = {
    'clangd',
    -- "--compile-commands-dir=.", -- 编译数据库路径
    -- "--clang-tidy",             -- 静态检查
    -- "--query-driver=/usr/bin/**",
  },
  filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
  root_markers = {
    '.clangd',
    '.clang-tidy',
    '.clang-format',
    'compile_commands.json',
    'compile_flags.txt',
    'configure.ac', -- AutoTools
    '.git',
  },
  capabilities = {
    textDocument = {
      completion = {
        editsNearCursor = true,
      },
    },
    offsetEncoding = { 'utf-8', 'utf-16' },
  },
}
